﻿using System;
using System.Web;
using System.Web.Routing;
using System.Web.Mvc;

namespace PhotoGallery.Modules
{
    public class LeaderModule : IModule
    {
        private readonly string[] controllerNamespaces;

        public LeaderModule()
        {
            this.controllerNamespaces = new String[] { "PhotoGallery.Modules.Leader.Controllers" };
        }

        #region IModule Members

        public void Initialize()
        {
        }

        public void Unload()
        {
        }

        public void RegisterRoutes(RouteCollection routes)
        {
            routes.MapRoute(
                "Leader", // Route name
                "leader/{action}/{id}", // URL with parameters
                new { controller = "Leader", action = "index", id = UrlParameter.Optional }, // Parameter defaults
                new { controller = "(Leader)", action = "(Index|List|Delete|Add|Save)" },
                controllerNamespaces
            );

        }

        public void RegisterModelBinders(ModelBinderDictionary binders)
        {
        }

        #endregion
    }
}
